package com.zhixuan.autoui.core;

import android.app.Application;
import android.util.Log;

import com.tinker.coresdk.manager.InitParams;
import com.tinker.coresdk.manager.ZXMainSDKInitializer;
import com.tinker.coresdk.manager.ZXMediaReportManager;
import com.tinker.coresdk.release.iface.MediaReportTool;

import cd.zhixuan.utils.GlobalTools;

public class CoreApplication extends Application implements ZXMainSDKInitializer.AutoCoreSdkInitListener {

    private static final String TAG = "AutoUI";

    @Override
    public void onCreate() {
        super.onCreate();
        Log.d(TAG, "BaseApplication.create... " + getPackageName());
        GlobalTools.init(this);
        InitParams initParams = new InitParams();
        initParams.setDebug(true);
        ZXMainSDKInitializer.getInstance().initMainSDK(getApplicationContext(), initParams, this);

        //
    }

    @Override
    public void onAutoCoreSdkInitSuccess() {
        Log.d(TAG, "onAutoCoreSdkInitSuccess");
        SpeechModule.getInstance().init();

        ZXMediaReportManager.getInstance().setTool(new MediaReportTool() {
            @Override
            public void onCloudServiceReady() {

            }

            @Override
            public void onCloudServiceDisconnected() {

            }

            @Override
            public void onReport2CloudServiceSuccess(String s) {

            }

            @Override
            public void onReport2CloudServiceFailure(String s, String s1) {

            }

            @Override
            public void onCurrentMediaSourceChange(int mediaType, int deviceType, String[] info) {
                Log.d(TAG, "onCurrentMediaSourceChange");


            }
        });


    }

    @Override
    public void onAutoCoreSdkDisconnected() {
        Log.d(TAG, "onAutoCoreSdkDisconnected");
    }
}
